﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Manager/Base.Master" AutoEventWireup="true" CodeBehind="Main.aspx.cs" Inherits="YXQ.Manager.Manager.Main" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

     <script type="text/javascript">
         $(function () {
             $('#dg').datagrid({
                 title: '最近五个工程',
                 iconCls: 'icon icon-nav',
                 height: 300,
                 nowrap: true,
                 autoRowHeight: false,
                 striped: true,
                 url: "../Handler/AdminHandler.ashx?OpType=GetTop",
                 sortOrder: 'desc',
                 remoteSort: false,

                 columns: [[
                         { field: 'Id', title: 'ID', width: 80 },
                         { field: 'ProjectName', title: '项目名称', width: 300 },
                         { field: 'StartTime', title: '开始时间', width: 200, formatter: Formatterdate },
                         { field: 'EndTime', title: '结束时间', width: 200, formatter: Formatterdate },
                         { field: 'Tpid', title: 'tpid', hidden: true },
                         {
                             field: 'opt', title: '操作', width: 200, align: 'center',
                             formatter: function (value, rec) {
                                 return "<%if (!string.IsNullOrEmpty(AdminUser.Depart))
                                          {%><a href='javascript:' id='edit'  onclick='Edit(" + rec.Id +","+rec.Tpid+ ")'>编辑</a>&nbsp;&nbsp;<%}%><a href='javascript:'  onclick=block(" + rec.Id + ",'" + rec.ProjectName + "'," + rec.Tpid + ")>详情</a>&nbsp;&nbsp;<a href='javascript:' onclick='Del(" + rec.Id + ")'>删除</a>";
                            }
                        }
                ]]



            });

        });
                    function Edit(val,tpid) {
                        YXQ.Manager.blockDialog("Project.aspx?id=" + val+"&tpid="+tpid, "修改项目", 300);
                    }

                    function Del(val) {
                        YXQCore.Form.PostData("../Handler/CommonHandler.ashx",
                                            { OpType: "Del", PostData: val },
                                            function (data) {

                                                if (data.ResultMessage == "Success") {
                                                    YXQ.Common.Message("恭喜你操作已经成功");
                                                    $("#dg").datagrid("reload");
                                                    return;
                                                }

                                            });
                    }

                    function Formatterdate(val, row) {
                        var dt = val.replace("T", " ");
                        var rtnDate = new Date(Date.parse(dt.replace(/-/g, "/")));
                        return rtnDate.getFullYear() + "-" + (rtnDate.getMonth() + 1) + "-" + rtnDate.getDate();
                    }
                    function block(cid, pName, tpid) {
                        var url = "ProjectDetail.aspx?id=" + cid + "&tpid=" + tpid + "&day=" + new Date();
                        YXQ.Manager.blockDialog(url, pName, ($(window).height() + 500));
                    }

                    function unblock() {

                        setTimeout($.unblockUI, 2000);

                    }
                    $(function () {
                        var demo = $("#showDemoBox");
                        demo.find("em").click(function () { unblock(); });
                    });

    </script>
    <table cellspacing="0" cellpadding="0" width="100%" class="admintable">
        <tr>
            <td>
                <table cellspacing="0" cellpadding="0" class="admintable01">
                    <tr>
                        <td>
                            <%=AdminUser.RealName %> 您好;欢迎你回来。您一共登录系统<%=AdminUser.LoginCount %>次，您上次登录系统的时间是：<%=AdminUser.LastLoginTime %>
                        </td>


                    </tr>
                </table>
            </td>
        </tr>
    </table>
      <table cellspacing="0" cellpadding="0" width="100%" class="admintable">
        <tr>
            <td>
                <table cellspacing="0" cellpadding="0" class="admintable01">
                    <tr>
                        <td>
                            最新问题
                        </td>


                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <div class="tbbutton">
        <ul>
            <li><span><a onclick="YXQ.Common.addTab('房建及房建附属工程','ProjectList.aspx?tpid=2','icon icon-nav')" href="javascript:">房建工程</a></span><img src="../images/but_2.gif" /></li>
            <li><span><a onclick="YXQ.Common.addTab('道路桥梁工程','ProjectList.aspx?tpid=3','icon icon-nav')" href="javascript:">路桥工程</a></span><img src="../images/but_2.gif" /></li>
            <li><span><a onclick="YXQ.Common.addTab('雨污管网工程','ProjectList.aspx?tpid=4','icon icon-nav')" href="javascript:">雨污官网</a></span><img src="../images/but_2.gif" /></li>
            <li><span><a onclick="YXQ.Common.addTab('平场护坡工程','ProjectList.aspx?tpid=5','icon icon-nav')" href="javascript:">平场护坡</a></span><img src="../images/but_2.gif" /></li>
            <li><span><a onclick="YXQ.Common.addTab('环境绿化工程','ProjectList.aspx?tpid=6','icon icon-nav')" href="javascript:">环境绿化</a></span><img src="../images/but_2.gif" /></li>
            <li><span><a onclick="YXQ.Common.addTab('水电气工程','ProjectList.aspx?tpid=7','icon icon-nav')" href="javascript:">水电气</a></span><img src="../images/but_2.gif" /></li>
            <li><span><a onclick="YXQ.Common.addTab('装饰修缮工程','ProjectList.aspx?tpid=8','icon icon-nav')" href="javascript:">装饰修缮</a></span><img src="../images/but_2.gif" /></li>
            <li><span><a onclick="YXQ.Common.addTab('零星工程','ProjectList.aspx?tpid=9','icon icon-nav')" href="javascript:">零星工程</a></span><img src="../images/but_2.gif" /></li>
        </ul>
    </div>
    <br />

    <table id="dg">
    </table>

</asp:Content>
